package com.leyou.upload.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OSSConfig {

    @Autowired
    private OSSProperties prop;

    @Bean
    public OSS client(){
        return new OSSClientBuilder().build(
                prop.getEndpoint(),
                prop.getAccessKeyId(),
                prop.getAccessKeySecret()
                );
    }
}
